home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / data / scripts / cityflag_scripts.lua < prev    next >
Encoding:
Text File  |  2004-06-17  |  1.6 KB  |  49 lines

  1.  
  2. -- scripts for unit section
  3. function units_cityflag_setup()
  4.     local flag = uniGetExecutor()
  5.     flag:setTransformOwner(units_findfreefirespot(uniGetTarget(),2))
  6.     flag:setLocalPosition(0,0,0)
  7. end
  8.  
  9. function units_cityflag_rise()
  10.     local flag = uniGetExecutor()
  11.     flag:addAnimationToQueue(ENAT_FIRE1,1)
  12.     flag:addAnimationToQueue(ENAT_AFTERFIRE1,MATH_INFINITY)
  13.     pause(0.7)
  14.     units_cityflag_destroyed()
  15. end
  16.  
  17. function units_cityflag_down()
  18.     local flag = uniGetExecutor()
  19.     flag:setCurrentAnimationRepeatCount(1)
  20.     flag:addAnimationToQueue(ENAT_FIRE2,1)
  21. end
  22.  
  23. function units_cityflag_destroyed()
  24. --    uniGetExecutor():addSimpleEffect(ENET_EFFECT_PS_AMBRELLAEXPLOSION):suspendedDestroy(1.2)
  25. end
  26.  
  27. -- register unit section
  28. registerCommand(ENSCRIPTSET_CITYFLAG,ENC_FIRE1,"units_cityflag_rise")
  29. registerCommand(ENSCRIPTSET_CITYFLAG,ENC_FIRE2,"units_cityflag_down")
  30. registerCommand(ENSCRIPTSET_CITYFLAG,ENC_SETUP,"units_cityflag_setup")
  31. registerCommand(ENSCRIPTSET_CITYFLAG,ENC_RESETUP,"units_cityflag_setup")
  32. registerCommand(ENSCRIPTSET_CITYFLAG,ENC_EXPLODE,"units_cityflag_destroyed")
  33.  
  34. -- make description of red flag
  35. desc = getEffectDescription(ENET_UNIT_GUARDTOWER_ALIEN)
  36. desc.FileName = "city_flag_red.rmd"
  37. desc.ScriptSet = ENSCRIPTSET_CITYFLAG
  38. desc.MoveType = ENMOVE_NOTALLOWED
  39. desc.Material = ENMAT_STATICMESH_TWOSIDE
  40. changeEffect(ENET_UNIT_CITYFLAG_RED,desc)
  41.  
  42. -- make description of green flag
  43. desc = getEffectDescription(ENET_UNIT_GUARDTOWER_ALIEN)
  44. desc.FileName = "city_flag_green.rmd"
  45. desc.ScriptSet = ENSCRIPTSET_CITYFLAG
  46. desc.MoveType = ENMOVE_NOTALLOWED
  47. desc.Material = ENMAT_STATICMESH_TWOSIDE
  48. changeEffect(ENET_UNIT_CITYFLAG_GREEN,desc)
  49.